package com.alex.service.impl;

import com.alex.entity.User;
import com.alex.mapper.UserMapper;
import com.alex.service.UserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

@Service("userService")
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public User getById(int id) {
        return userMapper.selectById(id);
    }

    @Override
    public List<User> getAll() {
        return null;
    }

    @Override
    @Transactional(propagation = Propagation.NOT_SUPPORTED)
    public void loginErrorCount(User user) {
        userMapper.updateById(user);
    }
}
